
from SistemaOperativo.PageTable import PageTable

class  PCB:
    def __init__(self, pid, currentInstruction, totalInstructions, priority = 10):
        self.pid = pid
        self.currentInstruction = 0
        self.totalInstructions = totalInstructions
        self.priority = priority
        self.state = None
        self.baseRegistry = None
        self.limitRegistry = None
        self.pageTable = PageTable()
    
    #Devuelve true si tiene una proxima instruccion
    def hasNextInstruction(self): 
        return self.currentInstruction < self.totalInstructions
    
    #Retorna la proxima instruccion a ejecutar
    def nextInstruction(self):
        self.currentInstruction = self.currentInstruction + 1
        return self.currentInstruction
